// pages/achieveDetails/achieveDetails.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isOther: false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var itemDetail = app.globalData.driversOrders;
    console.log(itemDetail, "itemDetail")

    this.setData({
      itemDetail: app.globalData.driversOrders,
      id: itemDetail.id,
    })
    app.globalData.id = itemDetail.id
    console.log(this.data.itemDetail.returnPicsList)
    var pickUpNums = 0,
      totalWeight = 0,
      totalVolume = 0,
      pickUpPayedMoney = itemDetail.totalFee;
    this.setData({
      pickUpNums: pickUpNums,
      // pickUpPayedMoney: pickUpPayedMoney.toFixed(2),
      totalWeight: totalWeight,
      totalVolume: totalVolume,
     // insured: insured
    })
  },
  otherFee() { //查看其它费用
    var that = this
    that.setData({
      itemDetail: app.globalData.driversOrders,
      isOther: !that.data.isOther
    })
    // wx.navigateTo({
    //     url: "../other/other"
    // })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  cargo(e) {
    var item = JSON.stringify(e.currentTarget.dataset.item)
    var idx = e.currentTarget.dataset.index
    app.globalData.orderid = e.currentTarget.dataset.item.orders.orderGoodInfosList[idx].id
    wx.navigateTo({
      url: "../cargork/cargork?item=" + item + "&index=" + e.currentTarget.dataset.index
    })
  },
})